import {createImgUrl} from '@/utils/downloadUtil'
const getters = {

  sidebar: state => state.app.sidebar,
  size: state => state.app.size,
  device: state => state.app.device,

  visitedViews: state => state.tagsView.visitedViews,
  cachedViews: state => state.tagsView.cachedViews,

  token: state => state.user.token,
  username: state => state.user.username,
  hasLoadUser: state => state.user.hasLoadUser,
  userInfo: state => state.user.userInfo,
  avatar: state => {let a = createImgUrl(state.user.avatar);return a ? a : '/static/avatars/a0.png'},
  roles: state => state.user.roles,
  permissions: state => state.user.permissions,
  routes: state => state.user.routes,
  resourceUrl: state => state.user.resourceUrl,

}
export default getters
